package com.qing.design.patterns.visitor.example.visitor.impl;

import com.qing.design.patterns.visitor.example.user.impl.Student;
import com.qing.design.patterns.visitor.example.user.impl.Teacher;
import com.qing.design.patterns.visitor.example.visitor.Visitor;

/**
 * 家长访问者
 */
public class Parent implements Visitor {
    @Override
    public void visit(Student student) {
        System.out.println("学生信息 姓名"+student.name+" 班级 "+student.clazz+" 排名 "+student.ranking());
    }

    @Override
    public void visit(Teacher teacher) {
        System.out.println("教师信息 姓名"+teacher.name+" 班级 "+teacher.clazz);
    }
}
